Oracle has only released 12C database for Linux and Solaris platforms.. This article assumes that you already had Solaris 11 installed on Virtual box.
The first obvious step toward actual Oracle installation is to perform the pre installation tasks.
First step is to properly name your host machine. The host name should properly be provided with IP address for installation to continue. Ideally, your /etc/hosts file should look something like this.
10.0.2.15 VST-SOL-12C
127.0.0.1 localhost
The default installation of Solaris is normally good enough for Oracle install. You just have to configure one parameter. You can use the below mentioned command to set the required Kernel parameter. Remember that though you will have to use the Root login to run this command but at least one “oracle” user session should be opened.
# projadd -K "project.max-shm-memory=(privileged,4G,deny)" user.oracle
To confirm that parameter has been changed you can view the contents of /etc/project file.
# cat /etc/project
system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
user.oracle:100::::project.max-shm-memory=(privileged,4294967296,deny)
Also, add the following lines in /etc/inittab, immediately before the “startd” entry.
tm::sysinit:/usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 9000 > /dev/console
tm::sysinit:/usr/sbin/ndd -set /dev/tcp tcp_largest_anon_port 65500 > /dev/console
tm::sysinit:/usr/sbin/ndd -set /dev/udp udp_smallest_anon_port 9000 > /dev/console
tm::sysinit:/usr/sbin/ndd -set /dev/udp udp_largest_anon_port 65500 > /dev/console
You can check if packages required for Oracle are installed or not using the following command.
# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt SUNWcsl
system SUNWarc Lint Libraries (usr)
system SUNWbtool CCS tools bundled with SunOS
system SUNWcsl Core Solaris, (Shared Libs)
system SUNWlibC Sun Workshop Compilers Bundled libC
system SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
system SUNWlibms Math & Microtasking Libraries (Usr)
system SUNWsprot Solaris Bundled tools
system SUNWtoo Programming Tools
ERROR: information for "SUNWhea" was not found
ERROR: information for "SUNWi1of" was not found
ERROR: information for "SUNWi1cs" was not found
ERROR: information for "SUNWi15cs" was not found
ERROR: information for "SUNWxwfnt" was not found
As you can see, the last five packages are not installed. You can install these packages as below, one by one.
# pkg install SUNWhea
Packages to install: 1
Create boot environment: No
Create backup boot environment: No
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 1/1 1584/1584 3.2/3.2 74.8k/s
PHASE ITEMS
Installing new actions 1704/1704
Updating package state database Done
Updating image state Done
Creating fast lookup database Done
The last step is to create oracle user groups and directories and set appropriate permissions and environment.
# groupadd oper
# groupadd dba
# groupadd oinstall
# usermod -g oinstall -G dba oper oracle
# mkdir -p /u01/app/oracle/product/12.0.1/db_1
# chown -R oracle:oinstall /u01
# chmod -R 775 /u01
Finally add the following lines at the end of .profile of Oracle user.
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
# Select the appropriate ORACLE_BASE
ORACLE_HOSTNAME=VST-SOL-12C; export ORACLE_HOSTNAME
ORACLE_UNQNAME=CDB12C; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.0.1/db_1; export ORACLE_HOME
ORACLE_SID=CDB12C; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH
You are now ready to install Oracle 12C database on your system. Log in as Oracle user, navigate to directory where you extracted the installation media and run the runInstaller command.
$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 180 MB. Actual 4369 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4751 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-07-02_11-52-51AM. Please wait ..
The installer will start and you will see the screen like below.
You can skip this step and click Next.
Skip the software updates as well and click Next.
Choose Install and Configure database option and click Next.
Select on Server class and click Next.
Choose single instance installation and click Next.
Select the Typical install method and click Next.
Here you provide most of the options like Oracle base and home directories and also password for admin accounts. The last checkbox is important. If you check it then you will have to provide one PDB name. If you uncheck it then database will be created as Non Container database, the same as it would have been before 12C version. You obviously would want the database to be Container database. Click Next.
Provide the location of Oracle Inventory and also the OS group who will own it. Click Next.
This is the Install summary. Click Install once you are OK with all the options.
The installation normally takes some time to complete.
Once installation is complete, you will be asked the run the scripts as Root.
# . /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
# . /u01/app/oracle/product/12.0.1/db_1/root.sh
Performing root user operation for Oracle 12c
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.0.1/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Creating /usr/local/bin directory...
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /var/opt/oracle/oratab file...
Entries will be added to the /var/opt/oracle/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Once you are done with that go back on Installer screen and click OK.
Once database has been created, you will be asked to do some password management.
You can always do this later. Click OK to finish the installation..
Once database has been created, you will be asked to do some password management. You can always do this later. Click OK to finish the installation.M
Click Close to exit the Installer. Oracle 12c Database Installation On Solaris is successful.You now log into your database to confirm if database has been created and configured.
$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Tue Jul 2 13:01:01 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
CDB12C
You can check which PDBs are configured and also you can log into PDB from within CDB as well.
SQL> select name,open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
PDB$SEED READ ONLY
PDB1 READ WRITE
SQL> alter session set container=PDB1;
Session altered.
SQL> select file_name from dba_data_files;
FILE_NAME
-------------------------------------------------------------------------
/u01/app/oracle/oradata/CDB12C/PDB1/example01.dbf
/u01/app/oracle/oradata/CDB12C/PDB1/SAMPLE_SCHEMA_users01.dbf
/u01/app/oracle/oradata/CDB12C/PDB1/sysaux01.dbf
/u01/app/oracle/oradata/CDB12C/PDB1/system01.dbf
Your Oracle 12c Database on Oracle Virtual Machine is ready for use!
Description:-
DG_BROKER_CONFIG_FILE1 & DG_BROKER_CONFIG_FILE2 Step by Step to configure Oracle 12c Data Guard Physical Standby
Let’s Start the Demo:- Step1 :-Creating a Service Listener in primary and standby side(Both Side)
[oracle@primary dbs]$ cd /u01/app/oracle/product/12.1.0.2/db_1/network/admin/
[oracle@primary admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = prime)
(ORACLE_HOME = /u01/app/oracle/product/12.1.0.2/db_1)
(SID_NAME = prime)
)
(SID_DESC =
(GLOBAL_DBNAME = stand)
(ORACLE_HOME = /u01/app/oracle/product/12.1.0.2/db_1)
(SID_NAME = stand)
)
(SID_DESC =
(GLOBAL_DBNAME = prime_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/12.1.0.2/db_1)
(SID_NAME = prime)
)
(SID_DESC =
(GLOBAL_DBNAME = stand_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/12.1.0.2/db_1)
(SID_NAME = stand)
)
)
After the changes in the listener file reload the listener
[oracle@primary dbs]$ lsnrctl stop
LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 12-JUN-2018 08:16:51
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.24)(PORT=1539)))
The command completed successfully
[oracle@primary dbs]$ lsnrctl start
LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 12-JUN-2018 08:16:53
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Starting /u01/app/oracle/product/12.1.0.2/db_1/bin/tnslsnr: please wait…
TNSLSNR for Linux: Version 12.1.0.2.0 – Production
System parameter file is /u01/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/primary/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.24)(PORT=1539)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.24)(PORT=1539)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 – Production
Start Date 12-JUN-2018 08:16:53
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/primary/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.24)(PORT=1539)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary…
Service “prime” has 1 instance(s).
Instance “prime”, status UNKNOWN, has 1 handler(s) for this service…
Service “prime_DGMGRL” has 1 instance(s).
Instance “prime”, status UNKNOWN, has 1 handler(s) for this service…
Service “stand” has 1 instance(s).
Instance “stand”, status UNKNOWN, has 1 handler(s) for this service…
Service “stand_DGMGRL” has 1 instance(s).
Instance “stand”, status UNKNOWN, has 1 handler(s) for this service…
The command completed successfully
Step 2:-Changing the parameters for both side
Primary
SQL> ALTER SYSTEM SET dg_broker_start=true scope=spfile;
System altered.
SQL> ALTER SYSTEM SET local_listener='(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.24)(PORT = 1539))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prime)))’;
System altered.
Standby
SQL> ALTER SYSTEM SET dg_broker_start=true scope=spfile;
System altered.
SQL>ALTER SYSTEM SET local_listener='(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.25)(PORT = 1539))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = stand)))’;
System altered.
Step 3:- login in to the primary database through DGMGRL
[oracle@primary ~]$ export ORACLE_SID=prime
[oracle@primary ~]$ dgmgrl
DGMGRL for Linux: Version 12.1.0.2.0 – 64bit Production
Copyright (c) 2000, 2013, Oracle. All rights reserved.
Welcome to DGMGRL, type “help” for information.
DGMGRL> connect sys/oracle@prime
Connected as SYSDBA.
DGMGRL> show configuration;
ORA-16532: Oracle Data Guard broker configuration does not exist
Configuration details cannot be determined by DGMGRL
Step 4:-Configure Dataguard Broker for primary
DGMGRL> create configuration ‘hari’ as primary database is ‘prime’ connect identifier is prime;
Error: ORA-16698: LOG_ARCHIVE_DEST_n parameter set for object to be added Failed.
Fix for this issue
SQL> alter system set LOG_ARCHIVE_DEST_2= ‘ ‘; (both Side)
System altered.
DGMGRL> create configuration ‘hari’ as primary database is ‘prime’ connect identifier is prime;
Configuration “hari” created with primary database “prime”
DGMGRL> show configuration;
Configuration – hari
Protection Mode: MaxPerformance
Members:
prime – Primary database
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
Step 5:-Configure Dataguard Broker for standby
DGMGRL> Add database ‘stand’ as connect identifier is stand maintained as physical;
Database “stand” added
DGMGRL> show configuration;
Configuration – hari
Protection Mode: MaxPerformance
Members:
prime – Primary database
stand – Physical standby database<
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
Step 6:-Check using Verbose command
DGMGRL> show database verbose ‘stand’
Database – stand
Role: PHYSICAL STANDBY
Intended State: OFFLINE
Transport Lag: (unknown)
Apply Lag: (unknown)
Average Apply Rate: (unknown)
Active Apply Rate: (unknown)
Maximum Apply Rate: (unknown)
Real Time Query: OFF
Instance(s):
stand
Properties:
DGConnectIdentifier = ‘stand’
ObserverConnectIdentifier = ”
LogXptMode = ‘ASYNC’
RedoRoutes = ”
DelayMins = ‘0’
Binding = ‘optional’
MaxFailure = ‘0’
MaxConnections = ‘1’
ReopenSecs = ‘300’
NetTimeout = ’30’
RedoCompression = ‘DISABLE’
LogShipping = ‘ON’
PreferredApplyInstance = ”
ApplyInstanceTimeout = ‘0’
ApplyLagThreshold = ‘0’
TransportLagThreshold = ‘0’
TransportDisconnectedThreshold = ’30’
ApplyParallel = ‘AUTO’
StandbyFileManagement = ‘AUTO’
ArchiveLagTarget = ‘0’
LogArchiveMaxProcesses = ‘5’
LogArchiveMinSucceedDest = ‘1’
DbFileNameConvert = ‘/u01/app/oracle/oradata/PRIME/datafile/, /u01/app/oracle/oradata/STAND/datafile/’
LogFileNameConvert = ‘/u01/app/oracle/oradata/PRIME/onlinelog/, /u01/app/oracle/oradata/STAND/onlinelog/’
FastStartFailoverTarget = ”
InconsistentProperties = ‘(monitor)’
InconsistentLogXptProps = ‘(monitor)’
SendQEntries = ‘(monitor)’
LogXptStatus = ‘(monitor)’
RecvQEntries = ‘(monitor)’
StaticConnectIdentifier =‘(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.25)(PORT=1539))(CONNECT_DATA=(SERVICE_NAME=stand_DGMGRL)(INSTANCE_NAME=stand)(SERVER=DEDICATED)))’
StandbyArchiveLocation = ‘USE_DB_RECOVERY_FILE_DEST’
AlternateLocation = ”
LogArchiveTrace = ‘0’
LogArchiveFormat = ‘%t_%s_%r.dbf’
TopWaitEvents = ‘(monitor)’
Database Status:
DISABLED
DGMGRL> show database verbose ‘prime’
Database – prime
Role: PRIMARY
Intended State: OFFLINE
Instance(s):
prime
Properties:
DGConnectIdentifier = ‘prime’
ObserverConnectIdentifier = ”
LogXptMode = ‘ASYNC’
RedoRoutes = ”
DelayMins = ‘0’
Binding = ‘optional’
MaxFailure = ‘0’
MaxConnections = ‘1’
ReopenSecs = ‘300’
NetTimeout = ’30’
RedoCompression = ‘DISABLE’
LogShipping = ‘ON’
PreferredApplyInstance = ”
ApplyInstanceTimeout = ‘0’
ApplyLagThreshold = ‘0’
TransportLagThreshold = ‘0’
TransportDisconnectedThreshold = ’30’
ApplyParallel = ‘AUTO’
StandbyFileManagement = ‘AUTO’
ArchiveLagTarget = ‘0’
LogArchiveMaxProcesses = ‘4’
LogArchiveMinSucceedDest = ‘1’
DbFileNameConvert = ‘/u01/app/oracle/oradata/STAND/datafile, /u01/app/oracle/oradata/PRIME/datafile’
LogFileNameConvert = ‘/u01/app/oracle/oradata/STAND/onlinelog, /u01/app/oracle/oradata/PRIME/onlinelog’
FastStartFailoverTarget = ”
InconsistentProperties = ‘(monitor)’
InconsistentLogXptProps = ‘(monitor)’
SendQEntries = ‘(monitor)’
LogXptStatus = ‘(monitor)’
RecvQEntries = ‘(monitor)’
StaticConnectIdentifier = ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.24)(PORT=1539))(CONNECT_DATA=(SERVICE_NAME=PRIME_DGMGRL)(INSTANCE_NAME=prime)(SERVER=DEDICATED)))’
StandbyArchiveLocation = ‘USE_DB_RECOVERY_FILE_DEST’
AlternateLocation = ”
LogArchiveTrace = ‘0’
LogArchiveFormat = ‘%t_%s_%r.dbf’
TopWaitEvents = ‘(monitor)’
Database Status:
DISABLED
Step 7:-Enable the Dataguard broker
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;
Configuration – hari
Protection Mode: MaxPerformance
Members:
prime – Primary database
stand – Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 12 seconds ago)
DGMGRL> enable database ‘stand’;
Enabled.
DGMGRL> show database ‘stand’;
Database – stand
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Average Apply Rate: 3.00 KByte/s
Real Time Query: OFF
Instance(s):
stand
Database Status:
SUCCESS
Successfully configured the Dataguard Broker in 12c database.
Help us improve!
Get in touch with us